package com.story.api.moduler.song.aop;

import com.story.api.moduler.song.service.StatisticsService;
import org.aspectj.lang.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author Administrator
 * @decription
 * @Date 2018-05-11 9:45
 */
@Component
@Aspect
public class AnnotationDealAop {

    @Autowired
    private StatisticsService statisticsService;

    @Pointcut("@annotation(com.story.api.moduler.song.aop.UseApp)")
    private void useApp() {
    }

    @Pointcut("@annotation(com.story.api.moduler.song.aop.PlayCount)")
    private void playCount() {
    }

    @After("useApp()")
    public void statisticsUseAppCount() {
        statisticsService.statisticsUseApp();
    }

    @After("playCount()")
    public void statisticsPlayCount() {
        statisticsService.statisticsPlayCount();
    }
}
